package cn.tedu.csmall.stock.webapi.quartz;

import cn.tedu.csmall.stock.webapi.mapper.StockMapper;
import lombok.extern.slf4j.Slf4j;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.springframework.beans.factory.annotation.Autowired;

@Slf4j
public class StockJob implements Job {

    @Autowired
    private StockMapper stockMapper;

    @Override
    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
        stockMapper.updateStockCount("PU201",2);
        log.info("库存减少完成!");
    }
}
